/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author owtee
 */
@Embeddable
public class MenuPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 2)
    @Column(name = "Menu_Role")
    private String menuRole;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "Menu_Name")
    private String menuName;

    public MenuPK() {
    }

    public MenuPK(String menuRole, String menuName) {
        this.menuRole = menuRole;
        this.menuName = menuName;
    }

    public String getMenuRole() {
        return menuRole;
    }

    public void setMenuRole(String menuRole) {
        this.menuRole = menuRole;
    }

    public String getMenuName() {
        return menuName;
    }

    public void setMenuName(String menuName) {
        this.menuName = menuName;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (menuRole != null ? menuRole.hashCode() : 0);
        hash += (menuName != null ? menuName.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof MenuPK)) {
            return false;
        }
        MenuPK other = (MenuPK) object;
        if ((this.menuRole == null && other.menuRole != null) || (this.menuRole != null && !this.menuRole.equals(other.menuRole))) {
            return false;
        }
        if ((this.menuName == null && other.menuName != null) || (this.menuName != null && !this.menuName.equals(other.menuName))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.MenuPK[ menuRole=" + menuRole + ", menuName=" + menuName + " ]";
    }
    
}
